package screen1;

import java.util.ArrayList;
import java.util.List;

/**
 * @author sk.z
 */
public class Line {

    private List<Point> list = new ArrayList<>();

    public void add(Point point){
        list.add(point);
        point.myLine = this;
    }

    public void show(){
        int prePlace = 0;
        for (Point p : list){
            int fillNum = p.deep - prePlace;
            for (int i=0;i<fillNum;i++){
                System.out.print(" ");
            }
            prePlace = p.deep;
            System.out.print(p.name);
        }
        System.out.println();
    }
}
